package cn.wolfcode.trip.admin.web.controller;

import cn.wolfcode.trip.admin.web.util.UploadUtil;
import cn.wolfcode.trip.base.domain.Daily;
import cn.wolfcode.trip.base.query.DailyQueryObject;
import cn.wolfcode.trip.base.query.QuestionnaireQueryObject;
import cn.wolfcode.trip.base.service.IDailyService;
import cn.wolfcode.trip.base.service.IQuestionnaireService;
import cn.wolfcode.trip.base.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

@Controller
@RequestMapping("/questionnaire")
public class QuestionnaireController {

    @Autowired
    private IQuestionnaireService questionnaireService;

    @RequestMapping("/list")
    public String query(@ModelAttribute("qo")QuestionnaireQueryObject qo, Model model){
        qo.setPageSize(8);
        model.addAttribute("result", questionnaireService.query(qo));
        return "/questionnaire/questionnaire";
    }


    @RequestMapping("/evaluate")
    public String queryEvaluate(@ModelAttribute("qo")QuestionnaireQueryObject qo, Model model){
        qo.setPageSize(3);
        model.addAttribute("result", questionnaireService.queryEvaluate(qo));
        return "/questionnaire/evaluate";
    }

}
